
#include "goods_widget.h"

GoodsWidget::GoodsWidget(QWidget *parent) :
        QWidget(parent)
{
    ui.setupUi(this);
}

GoodsWidget::~GoodsWidget()
{

}

void GoodsWidget::setPic(const QImage &image,const int &width,const int &height)
{
    ui.label_pic->setPixmap(QPixmap::fromImage(image.scaled(width, height, Qt::KeepAspectRatioByExpanding)));
}

void GoodsWidget::setName(const QString &name)
{
    ui.label_good_name->setText(name);
    ui.label_good_name->setWordWrap(true);
}

void GoodsWidget::setPrice(const QString &price)
{
    ui.label_good_price->setText(price);
}

